/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.basics.editor.model.document;

import java.io.File;
import java.rmi.server.UID;

/**
 * Describe a document.
 * 
 * @param <E>
 *          The generic element.
 */
public interface Document<E extends Element<?>>
{

  /**
   * Check whether the settings are valid.
   * 
   * @return whether the settings are valid.
   */
  public boolean accept();



  /**
   * Get the document name.
   * 
   * @return the document name.
   */
  public String getName();



  /**
   * The unique ID.
   * 
   * @return the unique ID.
   */
  public UID getUniqueId();



  /**
   * Get the xml file.
   * 
   * @return the xml file.
   */
  public File getXml();



  /**
   * Get whether the document is saved and has not been modified.
   * 
   * @return whether the document is saved and has not been modified.
   */
  public boolean isSaved();



  /**
   * Set whether the document is saved and has not been modified.
   * 
   * @param saved
   *          whether the document is saved and has not been modified.
   */
  public void setIsSaved(boolean saved);



  /**
   * Set the document name.
   * 
   * @param name
   *          the document name.
   */
  public void setName(String name);



  /**
   * Set the xml file.
   * 
   * @param xml
   *          the xml file.
   */
  public void setXml(File xml);



  /**
   * Get the main element.
   * 
   * @return the main element.
   */
  public E getElementModel();



  /**
   * Set the main element.
   * 
   * @param element
   *          the main element.
   */
  public void setElementModel(E element);



  /**
   * Update the specified element.
   * 
   * @param updatedElement
   *          the update element model.
   */
  public void updateElement(E updatedElement);

}
